
import React from 'react';
import { HashRouter as Router, Route, Switch } from 'react-router-dom';
import Tabbar from './views/Tabbar/Tabbar.jsx'
import Home from './views/Home/home.jsx'
import HomeSon from './views/Home/homeson.jsx'
import Index from './views/Index/index.jsx'
import SearchData from './views/SearchData/SearchData.jsx'
import Bar from './views/Bar/Bar.jsx'
import Shops from './views/Shop/Shop.jsx'
import ShopDetail from './views/ShopDetail/ShopDetail'
import AllEvaluation from './views/AllEvaluation/AllEvaluation'
import FillOrder from './views/FillOrder/FillOrder'
import PayOK from './views/PayOK/PayOK'
import shoppingCart from './views/shoppingCart/shoppingCart'
import User from './views/User/User'
import Modify from './views/Modify/Modify'
import Order from './views/Order/Order'
import OrderDetails from './views/OrderDetails/OrderDetails'
import AfterSale from './views/AfterSale/AfterSale'
import ReturnOrder from './views/ReturnOrder/ReturnOrder'
import Account from './views/Account/Account'
import withdraw from './views/withdraw/withdraw'
import MySubordinate from './views/MySubordinate/MySubordinate'
import SubordinateDetail from './views/SubordinateDetail/SubordinateDetail'
import AddCard from './views/AddCard/AddCard'
import AllAddress from './views/AllAddress/AllAddress'
import AddAddress from './views/AddAddress/AddAddress'
import PayClass from './views/PayClass/PayClass'
import InviteCode from './views/InviteCode/InviteCode'
import Expressage from './views/Expressage/Expressage'
import Evaluation from './views/Evaluation/Evaluation'
import Refund from './views/Refund/Refund'
import RefundDetail from './views/RefundDetail/RefundDetail'

const customHistory = require("history").createBrowserHistory;
const BasicRoute = () => (
    <div>
        <Router history={customHistory}>
            <Switch>
                <Route path="/index/">
                    <Tabbar>
                        <Switch>
                            <Route path="/index/home/:id" component={Home} />
                            <Route path="/index/homeson" component={HomeSon} />
                            <Route path="/index/shop" component={Shops} />
                            <Route path="/index/shoppingCart" component={shoppingCart} />
                            <Route path="/index/User" component={User} />
                            <Route component={Index} />
                        </Switch>
                    </Tabbar>
                </Route>
                <Route path='/'>
                    <Bar>
                        <Switch>
                            <Route path="/searchdata/:search" component={SearchData} />
                            <Route path='/shopdetail/:id' component={ShopDetail} />
                            <Route path='/AllEvaluation/:id' component={AllEvaluation} />
                            <Route path='/FillOrder/:ID/:commonId/:goodsId/:num/:addressId/:inviteCode' component={FillOrder}></Route>
                            <Route path='/AddCard/:ID/:commonId/:goodsId/:num/:addressId/:inviteCode' component={AddCard}></Route>
                            <Route path='/AllAddress/:ID/:commonId/:goodsId/:num/:addressId/:inviteCode' component={AllAddress}></Route>
                            <Route path='/PayOK' component={PayOK}></Route>
                            <Route path='/Modify' component={Modify}></Route>
                            <Route path='/Order/:id' component={Order}></Route>
                            <Route path='/OrderDetails/:id' component={OrderDetails}></Route>
                            <Route path='/AfterSale/:id/:url' component={AfterSale}></Route>
                            <Route path='/Expressage/:id' component={Expressage}></Route>
                            <Route path='/Evaluation/:id' component={Evaluation}></Route>
                            <Route path='/ReturnOrder/:id' component={ReturnOrder}></Route>
                            <Route path='/Account' component={Account}></Route>
                            <Route path='/withdraw' component={withdraw}></Route>
                            <Route path='/MySubordinate' component={MySubordinate}></Route>
                            <Route path='/SubordinateDetail' component={SubordinateDetail}></Route>
                            <Route path='/AddAddress/:id' component={AddAddress}></Route>
                            <Route path='/PayClass/:id' component={PayClass}></Route>
                            <Route path='/RefundDetail/:id' component={RefundDetail}></Route>
                            <Route path='/InviteCode' component={InviteCode}></Route>
                            <Route path='/Refund' component={Refund}></Route>
                            </Switch>
                    </Bar>
                </Route>
            </Switch>
        </Router>
    </div>
);


export default BasicRoute;
